<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge" />
    <title>Document</title>
  </head>
  <body>
    <sup>f gd hf </sup>
      <button onclick="add()">计算成绩</button>
    <script>
      function add() {
        let sum=0
        for (let i = 1; i <= 5; i++) {
          let s = prompt("输入第" + i + "个成绩");
          if (!isNaN(s) && s>=0) {
            sum+=parseInt(s)
          } else {
            return;
          }
        }
        document.write(sum);
      }
      
    </script>
  </body>
 
</html>
